{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#tab_basic">积分设置</a></li>
</ul>
<div class="app-content">
    <div class="app-form">
        <form action="" method="post" class="form-horizontal form form-validate" id="setting-form">
            <div class="panel panel-default">
                <div class="panel-heading">积分设置</div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">评价送积分</label>
                    <div class="col-sm-9">
                        <div class="input-group">
                            <input type="text" name="data[commentcredit]" class="form-control" value="{$settings['commentcredit']}">
                            <span class="input-group-addon">积分</span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">积分抵扣</label>
                    <div class="col-sm-9">
                        <label class="radio-inline" onclick="$('#proportion').show()" >
                            <input type="radio" name="data[dkstatus]" value="1" {if intval($settings['dkstatus']) == 1}checked="checked"{/if}>开启
                        </label>
                        <label class="radio-inline" onclick="$('#proportion').hide()">
                            <input type="radio" name="data[dkstatus]" value="0" {if intval($settings['dkstatus']) == 0 || empty($settings['dkstatus'])}checked="checked"{/if}>关闭
                        </label>
                    </div>
                </div>
                <div id = 'proportion' {if intval($settings['dkstatus']) == 0 || empty($settings['dkstatus'])} style="display: none;" {/if} >
                    <div class="form-group" >
                        <label class="col-sm-2 control-label">抵扣比例</label>
                        <div class="col-sm-9">
                            <div class="input-group">
                                <input type="text" name="data[proportion]" class="form-control" value="{$settings['proportion']}">
                                <span class="input-group-addon">积分抵扣一元</span>
                            </div>
                            <span class="help-block">为防止出错，请保证输入的抵扣比例能把1除尽。</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">积分抵扣订单不赠送积分</label>
                        <div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name="data[nointegral]" value="1" {if intval($settings['nointegral']) == 1}checked="checked"{/if}>开启
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="data[nointegral]" value="0" {if intval($settings['nointegral']) == 0 || empty($settings['nointegral'])}checked="checked"{/if}>关闭
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">积分抵扣订单不参与分销</label>
                        <div class="col-sm-9">
                            <label class="radio-inline">
                                <input type="radio" name="data[nodistribution]" value="1" {if intval($settings['nodistribution']) == 1}checked="checked"{/if}>开启
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="data[nodistribution]" value="0" {if intval($settings['nodistribution']) == 0 || empty($settings['nodistribution'])}checked="checked"{/if}>关闭
                            </label>
                        </div>
                    </div>
                </div>
                {if Customized::init('integral074') > 0}
                <div class="form-group" >
                    <label class="col-sm-2 control-label">转赠手续费</label>
                    <div class="col-sm-9">
                        <div class="input-group">
                            <input type="text" name="data[integralsxf]" class="form-control" value="{$settings['integralsxf']}">
                            <span class="input-group-addon">%</span>
                        </div>
                        <span class="help-block">用户发起积分转赠时收取的手续费，最多保留两位小数。</span>
                    </div>
                </div>
                {/if}
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <div class="col-sm-9">
                    <input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
                    <input type="hidden" name="token" value="{$_W['token']}" />
                </div>
            </div>
        </form>
    </div>
</div>
<script>
$(function () {
		window.optionchanged = false;
		$('#myTab a').click(function (e) {
			e.preventDefault();//阻止a链接的跳转行为
			$(this).tab('show');//显示当前选中的链接及关联的content
		})
	});
</script>
{php include wl_template('common/footer');}